package cn.youframe.sample.editor;

import cn.youframe.frame.base.BaseCtrl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * User: Administrator
 * DateTime: 12-7-5: 上午11:28
 */
@Controller
@RequestMapping(value = "/sample")
public class EditorCtrl extends BaseCtrl{
    /**
     * 简单编辑提交
     * @param request
     * @return
     */
    @RequestMapping(value = "/EditorCtrl!simpleEditor.do")
    public String simpleEditor(HttpServletRequest request){
        String content=request.getParameter("content");
        request.setAttribute("content",content);
        return "sample/editor/SimpleEditor";
    }

    /**
     * 默认编辑器
     * @param request
     * @return
     */
    @RequestMapping(value = "/EditorCtrl!defaultEditor.do")
    public String defaultEditor(HttpServletRequest request){
        String content=request.getParameter("content");
        logger.info("content="+content);
        request.setAttribute("content",content);
        return "sample/editor/DefaultEditor";
    }
}
